今天要介紹 markercluster 套件其他設定
const markers = L.markerClusterGroup({
spiderfyOnMaxZoom: false,
zoomToBoundsOnClick: false,
spiderLegPolylineOptions: {
weight: 5,
color: "red",
opacity: 1,
},
iconCreateFunction: function (cluster) {
return L.divIcon({ html: "<div>" + cluster.getChildCount() + "</div>" });
},
});
設定 false 就不會散開
https://github.com/Leaflet/Leaflet.markercluster#options